import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

// 查询ERP物料主数据列表
export function listErpItem(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpItem/list',
    method: 'post',
    data: data
  })
}

// 查询ERP物料主数据详细
export function getErpItem(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpItem/detail',
    method: 'get',
    params: {
        id
    }
  })
}

// 新增/修改ERP物料主数据
export function addOrUpdateErpItem(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpItem/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除ERP物料主数据
export function delErpItem(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpItem/deleteByIds',
    method: 'post',
    params: {
      ids: id
    }
  })
}

// 导出ERP物料主数据
export function exportErpItem(query) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/erpItem/export',
    method: 'post',
    data: query
  })
}
